package com.canis.stockmanager.repository;

import com.canis.stockmanager.domai.Operator;
import com.canis.stockmanager.domai.result.Combox;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OperatorRepository  extends JpaRepository<Operator, Long> {
    Page<Operator> findByNameContainingAndPhoneContainingAndAddressContaining(String name, String phone,String address, Pageable pageable);

    @Query(value="select o.name as name, o.id as value from Operator o ")
    List findByNameContaining(String name);
}
